package main

import (
	"SYY/router"
	"fmt"

	"SYY/handler"
	"os"
	"path/filepath"

	"github.com/henrylee2cn/faygo"
)

func main() {
	if true {
		router.Route(faygo.New("SYY"))
		faygo.SetErrorFunc(func(ctx *faygo.Context, errStr string, status int) {
			fmt.Println("目标站点被拦截::", errStr)
			ctx.Render(200, "view/404.html", faygo.Map{
				"status": status,
				"error":  errStr,
			})
		})
		go handler.ORM()
		faygo.Run()
	} else {
		test()
	}
}

func test() {
	filepath.Walk("./upload", func(path string, f os.FileInfo, err error) error {
		println(path)
		fmt.Println(f.IsDir())
		return nil
	})
}
